package com.guard.net;

import com.guard.location.PatrolData;
import com.guard.ui.MapGuardActivity;

public class UpdateTaxiDataController extends UpdateController {

	public UpdateTaxiDataController(MapGuardActivity activity) {
		super(activity);
	}

	@Override
	public UpdateTask getUpdateTask() {
		return new UpdateTaxiDataTask();
	}

	@Override
	public void onFinished(Object obj) {
		super.onFinished(obj);
		if (mActivity != null) {
			if (obj instanceof HttpConnectionError) {
				mActivity.showConnectionErrorDialog();
			} else if (mActivity instanceof MapGuardActivity) {
				((MapGuardActivity) mActivity).updateMapData((PatrolData) obj);
			}
		}
	}

}
